﻿@page "/demos/snaptogrid"
@inherits SnapToGridComponent
@layout DemoLayout
@inject LayoutData LayoutData

@code {
    protected override void OnInitialized()
    {
        base.OnInitialized();

        LayoutData.Title = "Snap to Grid";
        LayoutData.Info = "This diagram has a grid size of 50, moving nodes will make them automatically snap.<br />" +
                "The background grid isn't added by Z.Blazor.Diagrams, in order for you to use whatever you want.";
        LayoutData.DataChanged();
    }
}

<CascadingValue Value="diagram">
    <DiagramCanvas Class="grid">
        <Widgets>
            <NavigatorWidget Width="300" Height="200" DefaultStyle="true"></NavigatorWidget>
        </Widgets>
    </DiagramCanvas>
</CascadingValue>
